using System;

namespace Mbl.ParameterizedTest.FluentCollectionBuilding.Expectors.StringExpectations
{
    public class EqualityIgnoringCaseExpectation : PredicateExpectation<string>
    {
        private readonly string _expected;

        public EqualityIgnoringCaseExpectation(string expected)
            : base(actual => string.Equals(actual, expected, StringComparison.CurrentCultureIgnoreCase))
        {
            _expected = expected;
        }

        protected override string GetErrorMessage(string actual)
        {
            return $"Expected <{_expected}>. Actual <{actual}>.";
        }        
    }
}